<script setup>
import { useStore } from '@/stores/index'

const store = useStore() // 实例化useStore
</script>

<template>
  <div id="header">
    <a href="/" style="text-decoration: none;" class="no-underline">PYS❤CQ</a> 
    <span style="font-size: medium;"> / </span> 
    <a v-if="!store.$state.userInfo" href="/login" style="text-decoration: none" class="no-underline">登录</a>
    <a v-else href="/user" style="text-decoration: none" class="no-underline">{{ store.$state.userInfo.nickname }}</a>
  </div>
</template>

<style>
#header > a {
  color: aqua;
}
</style>
